﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ManterImagem.aspx.cs" Inherits="ManterImagem" Title="Untitled Page" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<div class="demoheading" style="width:400"> Manter Imagem</div>
<div class="collapsePanelHeader" style="width:400px; height:15px">Consultar Imagem</div>

<div style="width:400px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
            BorderStyle="None" BorderWidth="1px" CellPadding="4" 
            ForeColor="Black" GridLines="Vertical" Width="400px" DataSourceID="obsImagem" 
            >
            <FooterStyle BackColor="#CCCC99" />
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:BoundField HeaderText="Cod" DataField="Cod" SortExpression="Cod" />
                <asp:BoundField HeaderText="Nome" DataField="Nome" SortExpression="Nome" />
                <asp:BoundField HeaderText="Localizacao" DataField="Localizacao" 
                    SortExpression="Localizacao" />
                <asp:TemplateField HeaderText="Atualizar / Remover">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbAtualiza" runat="server" onclick="lbAtualiza_Click">Atualizar</asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="lbRemove" runat="server" onclick="lbRemove_Click">Remover</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        
        <asp:ObjectDataSource ID="obsImagem" runat="server" 
            DataObjectTypeName="Negocios.Imagem" DeleteMethod="Remove" 
            InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="ConsultaTodos" TypeName="Negocios.ImagemBLL" 
            UpdateMethod="Atualiza"></asp:ObjectDataSource>
        
<br />
<div class="collapsePanelHeader" style="width:400px; height:15px"></div>

        <table style="width: 100%" class="divDados">
            <tr class="divOID">
                <td style="width: 126px">
                    <asp:Label ID="Label1" runat="server" Text="Código"></asp:Label>
                </td>
                <td>
                    <p>
                        <asp:TextBox ID="tbCodigo" runat="server" Enabled="False"></asp:TextBox>
                        &nbsp;
                        <asp:Button ID="btNovo" runat="server" onclick="btNovo_Click" 
                            Text="Nova" />
                    </p>
                </td>
            </tr>
            <tr>
                <td style="width: 126px">
                    <asp:Label ID="Label2" runat="server" Text="Nome"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbNome" runat="server" Enabled="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 126px">
                    <asp:Label ID="Label3" runat="server" Text="Localização"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbLocalizacao" runat="server" Enabled="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="center" style="text-align: left">
                    <asp:Label ID="Label4" runat="server" Text="Evento"></asp:Label>
                </td>
                <td align="center" style="text-align: left">
                    <asp:DropDownList ID="ddlEvento" runat="server" AppendDataBoundItems="True" 
                        Enabled="False" DataSourceID="obsEvento" DataTextField="Nome" 
                        DataValueField="Codigo">
                        <asp:ListItem Value="0">Selecione o Evento</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="obsEvento" runat="server" 
                        OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                        TypeName="Negocios.EventoBLL" DataObjectTypeName="Negocios.Evento" 
                        InsertMethod="Insere"></asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td align="center" style="text-align: left">
                    <asp:Label ID="Label5" runat="server" style="text-align: left" Text="Autor"></asp:Label>
                </td>
                <td align="center" style="text-align: left">
                    <asp:DropDownList ID="ddlAutor" runat="server" AppendDataBoundItems="True" 
                        DataSourceID="obsAutor" DataTextField="Nome" DataValueField="Codigo" 
                        Enabled="False">
                        <asp:ListItem Value="0">Selecione o Autor</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="obsAutor" runat="server" 
                        DataObjectTypeName="Negocios.Autor" DeleteMethod="Remove" InsertMethod="Insere" 
                        OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                        TypeName="Negocios.AutorBLL" UpdateMethod="Atualiza"></asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td align="center" style="text-align: left">
                    <asp:Label ID="Label6" runat="server" style="text-align: left" Text="Formato"></asp:Label>
                </td>
                <td align="center" style="text-align: left">
                    <asp:DropDownList ID="ddlFormato" runat="server" AppendDataBoundItems="True" 
                        DataSourceID="obsFormato" DataTextField="Nome" DataValueField="Codigo" 
                        Enabled="False">
                        <asp:ListItem Value="0">Selecione o Formato</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="obsFormato" runat="server" 
                        DataObjectTypeName="Negocios.Formato" DeleteMethod="Remove" 
                        InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="ConsultaTodos" TypeName="Negocios.FormatoBLL" 
                        UpdateMethod="Atualiza"></asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td align="center" style="text-align: left">
                    <asp:Label ID="Label7" runat="server" Text="Especificação"></asp:Label>
                </td>
                <td align="center" style="text-align: left">
                    <asp:DropDownList ID="ddlEspecificacao" runat="server" 
                        AppendDataBoundItems="True" DataSourceID="obsespecificao" DataTextField="Nome" 
                        DataValueField="Id" Enabled="False">
                        <asp:ListItem Value="0">Selecione a Especificação</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="obsespecificao" runat="server" 
                        DataObjectTypeName="Negocios.Especificacao" InsertMethod="Insere" 
                        OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodosVisao" 
                        TypeName="Negocios.EspecificacaoBLL"></asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td align="center" style="text-align: left; height: 17px;">
                    Software</td>
                <td align="center" style="text-align: left; height: 17px;">
                    <asp:DropDownList ID="ddlSoftware" runat="server" DataSourceID="obsSoftware" 
                        DataTextField="Nome" DataValueField="Codigo" AppendDataBoundItems="True" 
                        Enabled="False">
                        <asp:ListItem Value="0">Selecione o Software</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="obsSoftware" runat="server" 
                        DataObjectTypeName="Negocios.SoftwareDeReproducao" DeleteMethod="Excluir" 
                        InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="ConsultaTodos" TypeName="Negocios.Software_De_ReproducaoBLL" 
                        UpdateMethod="Atualizar">
                    </asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <asp:Button ID="btGravar" runat="server" Height="26px" Text="Gravar" 
                        Width="55px" onclick="btGravar_Click" />
                    <cc1:ConfirmButtonExtender ID="btGravar_ConfirmButtonExtender" runat="server" 
                        ConfirmText="Confirma gravação?" Enabled="True" TargetControlID="btGravar">
                    </cc1:ConfirmButtonExtender>
                    <asp:Button ID="btCancelar" runat="server" Height="26px" Text="Cancelar" 
                        onclick="btCancelar_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:Label ID="lbErro" runat="server" CssClass="erro"></asp:Label>
        <br />
    </ContentTemplate>    
</asp:UpdatePanel>
</div>
</asp:Content>

